import {createRouter,createWebHistory,createWebHashHistory} from 'vue-router'
import CSS from '@/views/route/CSS.vue'
import HTML from '@/views/route/HTML.vue'
import JavaScript from '@/views/route/JavaScript.vue'
import JavaScriptChapter1 from '@/views/route/js/JavaScript1.vue'
import JavaScriptChapter2 from '@/views/route/js/JavaScript2.vue'
import CssDetail from '@/views/route/css/CssDetail.vue'

const router = createRouter(
    
    {
	// history:createWebHistory(), //有的需要后端特殊处理
	history:createWebHashHistory(), // 不会修改路径
	routes:[
		{
			path:'/html',
			component:HTML
		},
		{
			name:'CSS',
			path:'/css',
			component:CSS,
			children:[
				{
					path:'/css/detail',
					component:CssDetail
				}
			]
		},
        {
			path:'/js',
			component:JavaScript,
			children:[
				{
					path:'/js/chapter1',
					component:JavaScriptChapter1
				},
				{
					path:'/js/chapter2',
					component:JavaScriptChapter2
				},
			]
		}
	]
}


)
export default router